

CHAR_WHITE = ' '
CHAR_ZERO = '0'


class Screen82MS:
    def __init__(self):
        self.__buf_num = [CHAR_ZERO for _ in range(10)]  # 10 digits
        self.__buf_expr = [CHAR_WHITE for _ in range(12)]

    def expr_put(self, char, pos: int):
        if 0 <= pos < len(self.__buf_expr):
            self.__buf_expr[pos] = char

    def num_put(self, num_or_char, pos: int):
        if 0 <= pos < len(self.__buf_num):
            self.__buf_num[pos] = num_or_char

    def expr_put_line(self, line: str):
        line = line[:12]
        if len(line) < 12:
            line += CHAR_WHITE * (12 - len(line))
        self.__buf_expr = list(line)

    def num_put_line(self, line: str):
        line = line[:10]
        if len(line) < 12:
            line += CHAR_ZERO * (12 - len(line))
        self.__buf_expr = list(line)
